package com.yanqu.road.server.logic.recharge;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.recharge.RechargeOrder;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.ActivityMallModule;
import com.yanqu.road.server.gameplayer.module.player.RechargeModule;

/**
 * 系统开放触发现金礼包
 */
public class SystemOpenTriggerRMBRecharge extends BaseRecharge {

    public SystemOpenTriggerRMBRecharge(GamePlayer player, MallInfo mallInfo, ActivityInfo activityInfo) {
        super(player, mallInfo, activityInfo);
    }

    @Override
    protected boolean isRepeatedBuy(String orderNo) {
        return player.getModule(ActivityMallModule.class).isOverLimitBuyCount(mallInfo, 1);
    }

    @Override
    protected void repeatedBuyLogic() {

    }

    @Override
    protected String addMall(String orderNo, RechargeOrder rechargeOrder) {
        //系统开放现金礼包
        player.getModule(RechargeModule.class).notifySystemOpenRMBMallActivity(mallInfo.getMallId());
        return mallInfo.getReward();
    }

}
